//
//  FLLFoodWebVC.m
//  FLLGodOfCooking
//
//  Created by LL.F on 16/9/12.
//  Copyright © 2016年 LL.F. All rights reserved.
//

#import "FLLFoodWebVC.h"
#import "FLLMacro.h"

@interface FLLFoodWebVC ()<UIWebViewDelegate>
@property (nonatomic, strong) UIWebView *webView;
@property (nonatomic, strong) NSString *idString;
@property (nonatomic, strong) NSString *urlString;
@end

@implementation FLLFoodWebVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    _webView = [[UIWebView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT - 64)];
    
    if (![_linkString containsString:@"="]) {
        self.urlString = [NSString stringWithFormat:@"http://h5.izhangchu.com/topic_view/index.html?&topic_id=%@&app_exitpage=1&from=app&", _linkString];
    } else {
    self.idString = [_linkString componentsSeparatedByString:@"="].lastObject;
    self.urlString = [NSString stringWithFormat:@"http://h5.izhangchu.com/topic_view/index.html?&topic_id=%@&app_exitpage=1&from=app&", _idString];
    }
    //加载网页:
    [_webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:_urlString]]];
    _webView.delegate = self;
    
    [self.view addSubview:_webView];
    

}

- (void)setLinkString:(NSString *)linkString
{

    _linkString = linkString;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
